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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.r: C = None
        self.x: A = None
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.o: E = None
        self.z: C = None
        self.t: B = None
        self.s: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: D = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.r: C = None
        self.x: A = None
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.o: E = None
        self.z: C = None
        self.t: B = None
        self.s: D = None
        self.txt = txt

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

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