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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: H = None
        self.w: E = None
        self.t: C = None
        self.u: E = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: G = None
        self.r: D = None
        self.q: E = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: C = None
        self.s: B = None
        self.w: D = None
        self.p: C = None
        self.q: A = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: H = None
        self.w: E = None
        self.t: C = None
        self.u: E = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: G = None
        self.r: D = None
        self.q: E = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: C = None
        self.s: B = None
        self.w: D = None
        self.p: C = None
        self.q: A = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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