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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: F = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.txt = txt

g = A("g")
j = B("j")
e = C("e")
l = D("l")
m = E("m")
a = F("a")
i = E("i")
b = A("b")

g.r = e
g.z = b
j.t = i
e.o = m
e.y = j
e.t = l
l.w = e
l.p = e
l.o = e
m.r = i
m.v = a
m.x = e
a.r = e
a.t = i
i.r = m
i.v = a
i.x = e
b.r = e
b.z = g
assert l.o.t.p.o.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: F = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.txt = txt

g = A("g")
j = B("j")
e = C("e")
l = D("l")
m = E("m")
a = F("a")
i = E("i")
b = A("b")

g.r = e
g.z = b
j.t = i
e.o = m
e.y = j
e.t = l
l.w = e
l.p = e
l.o = e
m.r = i
m.v = a
m.x = e
a.r = e
a.t = i
i.r = m
i.v = a
i.x = e
b.r = e
b.z = g
assert l.o.t.p.o.x.y.txt == "j"