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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
c = C("c")
i = D("i")
b = A("b")
j = C("j")
a = B("a")
k = D("k")
e = B("e")
f = A("f")

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
c = C("c")
i = D("i")
b = A("b")
j = C("j")
a = B("a")
k = D("k")
e = B("e")
f = A("f")

g.v = a
g.q = j
g.y = j
g.o = f
l.t = b
l.w = a
l.y = a
c.z = b
c.u = f
c.p = g
i.p = c
i.u = e
b.v = l
b.q = c
b.y = j
b.o = f
j.z = f
j.p = f
j.u = b
a.t = g
a.w = l
a.y = e
k.p = j
k.u = e
e.t = f
e.w = l
e.y = l
f.v = e
f.q = j
f.y = c
f.o = b
assert e.t.q.u.v.y.t.txt == "g"