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

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

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

f = A("f")
j = B("j")
e = C("e")
d = A("d")
k = B("k")
b = C("b")
c = C("c")
i = B("i")
n = C("n")
g = B("g")

f.o = d
f.y = d
f.z = g
j.x = d
j.o = d
j.v = n
e.t = f
d.o = f
d.y = f
d.z = j
k.x = d
k.v = c
k.o = f
b.t = f
c.t = f
i.x = d
i.v = n
i.o = f
n.t = d
g.x = d
g.v = n
g.o = f
assert j.v.t.y.y.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
e = C("e")
d = A("d")
k = B("k")
b = C("b")
c = C("c")
i = B("i")
n = C("n")
g = B("g")

f.o = d
f.y = d
f.z = g
j.x = d
j.o = d
j.v = n
e.t = f
d.o = f
d.y = f
d.z = j
k.x = d
k.v = c
k.o = f
b.t = f
c.t = f
i.x = d
i.v = n
i.o = f
n.t = d
g.x = d
g.v = n
g.o = f
assert j.v.t.y.y.y.o.txt == "d"