class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: H = None
        self.o: C = None
        self.w: B = None
        self.t: F = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.z: F = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.v: E = None
        self.p: H = None
        self.y: F = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: F = None
        self.z: F = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.v: E = None
        self.p: H = None
        self.y: F = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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