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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: F = None
        self.s: E = None
        self.r: E = None
        self.w: B = None
        self.p: D = None
        self.txt = txt

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

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

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

c = A("c")
d = B("d")
g = C("g")
m = D("m")
e = E("e")
n = F("n")
a = B("a")
h = F("h")
b = A("b")

c.t = e
c.v = g
c.q = g
d.o = e
d.x = e
d.w = a
d.s = m
g.x = b
g.z = n
g.s = e
g.r = e
g.w = a
g.p = m
m.r = d
m.p = e
m.z = a
e.v = n
e.p = h
e.x = c
e.o = c
e.q = m
n.x = h
a.o = e
a.x = e
a.w = d
a.s = m
h.x = n
b.t = e
b.v = g
b.q = g
assert g.p.p.p.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: C = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: F = None
        self.s: E = None
        self.r: E = None
        self.w: B = None
        self.p: D = None
        self.txt = txt

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

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

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

c = A("c")
d = B("d")
g = C("g")
m = D("m")
e = E("e")
n = F("n")
a = B("a")
h = F("h")
b = A("b")

c.t = e
c.v = g
c.q = g
d.o = e
d.x = e
d.w = a
d.s = m
g.x = b
g.z = n
g.s = e
g.r = e
g.w = a
g.p = m
m.r = d
m.p = e
m.z = a
e.v = n
e.p = h
e.x = c
e.o = c
e.q = m
n.x = h
a.o = e
a.x = e
a.w = d
a.s = m
h.x = n
b.t = e
b.v = g
b.q = g
assert g.p.p.p.x.x.txt == "h"