class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.q: A = None
        self.w: A = None
        self.v: C = None
        self.s: C = None
        self.p: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: A = None
        self.q: A = None
        self.w: A = None
        self.v: C = None
        self.s: C = None
        self.p: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

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

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

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