class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: C = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: G = None
        self.x: F = None
        self.o: H = None
        self.y: C = None
        self.q: C = None
        self.p: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: F = None
        self.y: F = None
        self.t: F = None
        self.txt = txt

c = A("c")
f = B("f")
a = C("a")
l = D("l")
n = E("n")
b = F("b")
j = G("j")
i = H("i")
d = C("d")
m = C("m")

c.p = i
c.r = d
c.u = f
c.z = b
f.u = j
f.z = i
a.u = j
l.s = b
n.t = j
n.w = j
n.x = b
n.o = i
n.p = i
n.y = a
n.q = m
b.z = j
b.w = l
b.u = i
j.q = c
j.w = n
i.x = f
i.v = b
i.y = b
i.t = b
d.u = j
m.u = j
assert d.u.q.z.w.s.u.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: C = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: G = None
        self.x: F = None
        self.o: H = None
        self.y: C = None
        self.q: C = None
        self.p: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: F = None
        self.y: F = None
        self.t: F = None
        self.txt = txt

c = A("c")
f = B("f")
a = C("a")
l = D("l")
n = E("n")
b = F("b")
j = G("j")
i = H("i")
d = C("d")
m = C("m")

c.p = i
c.r = d
c.u = f
c.z = b
f.u = j
f.z = i
a.u = j
l.s = b
n.t = j
n.w = j
n.x = b
n.o = i
n.p = i
n.y = a
n.q = m
b.z = j
b.w = l
b.u = i
j.q = c
j.w = n
i.x = f
i.v = b
i.y = b
i.t = b
d.u = j
m.u = j
assert d.u.q.z.w.s.u.v.z.txt == "j"