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

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

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

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

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

b.q = e
b.o = e
b.v = g
b.r = f
m.y = f
m.r = a
j.x = c
f.o = j
f.t = j
f.v = e
c.x = j
e.o = j
e.t = j
e.v = f
a.y = f
a.r = m
i.q = e
i.v = g
i.r = f
i.o = f
g.y = e
g.r = m
assert e.t.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: B = None
        self.r: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

b.q = e
b.o = e
b.v = g
b.r = f
m.y = f
m.r = a
j.x = c
f.o = j
f.t = j
f.v = e
c.x = j
e.o = j
e.t = j
e.v = f
a.y = f
a.r = m
i.q = e
i.v = g
i.r = f
i.o = f
g.y = e
g.r = m
assert e.t.x.x.x.txt == "c"