class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: E = None
        self.z: E = None
        self.q: C = None
        self.w: B = None
        self.txt = txt

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

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

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

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

d = A("d")
n = B("n")
j = C("j")
a = D("a")
l = E("l")
f = D("f")
e = A("e")
b = D("b")
c = C("c")
g = E("g")

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

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

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

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

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

d = A("d")
n = B("n")
j = C("j")
a = D("a")
l = E("l")
f = D("f")
e = A("e")
b = D("b")
c = C("c")
g = E("g")

d.s = e
d.v = g
d.z = g
d.q = c
d.w = n
n.o = b
j.o = c
a.q = b
a.x = b
a.y = b
l.p = n
l.q = e
l.o = j
l.u = b
f.q = a
f.x = b
f.y = b
e.s = d
e.v = g
e.z = l
e.q = c
e.w = n
b.q = a
b.x = f
b.y = f
c.o = j
g.p = n
g.q = e
g.o = j
g.u = f
assert f.q.x.x.q.x.y.txt == "f"