class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: C = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: A = None
        self.o: H = None
        self.p: C = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

i = A("i")
g = B("g")
n = C("n")
k = D("k")
h = E("h")
b = F("b")
m = G("m")
c = H("c")
j = E("j")

i.r = j
i.u = c
g.q = i
n.p = i
n.x = k
k.z = c
k.y = c
k.q = n
h.y = n
h.p = n
h.u = i
h.r = i
h.o = c
b.o = i
b.s = m
m.t = h
m.v = i
c.z = m
j.y = n
j.p = n
j.u = i
j.r = i
j.o = c
assert n.x.q.p.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: C = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: A = None
        self.o: H = None
        self.p: C = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

i = A("i")
g = B("g")
n = C("n")
k = D("k")
h = E("h")
b = F("b")
m = G("m")
c = H("c")
j = E("j")

i.r = j
i.u = c
g.q = i
n.p = i
n.x = k
k.z = c
k.y = c
k.q = n
h.y = n
h.p = n
h.u = i
h.r = i
h.o = c
b.o = i
b.s = m
m.t = h
m.v = i
c.z = m
j.y = n
j.p = n
j.u = i
j.r = i
j.o = c
assert n.x.q.p.r.u.txt == "i"