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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

g = A("g")
f = B("f")
e = C("e")
a = D("a")
d = E("d")
c = F("c")
i = E("i")
j = E("j")
h = B("h")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

g = A("g")
f = B("f")
e = C("e")
a = D("a")
d = E("d")
c = F("c")
i = E("i")
j = E("j")
h = B("h")

g.y = i
g.z = i
g.o = h
g.q = h
f.s = h
f.x = h
f.o = d
f.q = c
f.p = g
e.p = d
e.s = h
e.z = h
a.r = h
a.p = g
a.x = g
a.o = g
a.v = g
a.u = c
d.p = j
d.q = a
d.v = e
c.o = i
i.p = j
i.q = a
i.v = e
j.p = d
j.q = a
j.v = e
h.s = f
h.x = f
h.o = i
h.q = c
h.p = g
assert f.x.x.x.p.txt == "g"