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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: C = None
        self.o: D = None
        self.q: A = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.r: C = None
        self.s: B = None
        self.q: C = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.o: F = None
        self.s: B = None
        self.z: A = None
        self.u: D = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

h = A("h")
e = B("e")
k = C("k")
m = D("m")
b = E("b")
n = F("n")
l = G("l")
j = F("j")

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: C = None
        self.o: D = None
        self.q: A = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.r: C = None
        self.s: B = None
        self.q: C = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.o: F = None
        self.s: B = None
        self.z: A = None
        self.u: D = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

h = A("h")
e = B("e")
k = C("k")
m = D("m")
b = E("b")
n = F("n")
l = G("l")
j = F("j")

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