class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: H = None
        self.u: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: H = None
        self.y: F = None
        self.x: H = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: H = None
        self.y: F = None
        self.x: H = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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