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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: F = None
        self.x: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: F = None
        self.t: C = None
        self.w: A = None
        self.v: F = None
        self.p: A = None
        self.txt = txt

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

f = A("f")
b = B("b")
d = C("d")
c = D("c")
i = E("i")
l = F("l")
k = D("k")

f.y = l
f.z = i
b.r = f
b.q = d
b.v = k
d.q = i
d.w = i
c.u = l
c.o = l
c.x = i
c.z = f
i.o = d
i.t = d
i.u = l
i.v = l
i.w = f
i.p = f
l.t = d
l.r = f
k.u = l
k.o = l
k.x = i
k.z = f
assert i.v.r.z.w.y.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: F = None
        self.x: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: F = None
        self.t: C = None
        self.w: A = None
        self.v: F = None
        self.p: A = None
        self.txt = txt

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

f = A("f")
b = B("b")
d = C("d")
c = D("c")
i = E("i")
l = F("l")
k = D("k")

f.y = l
f.z = i
b.r = f
b.q = d
b.v = k
d.q = i
d.w = i
c.u = l
c.o = l
c.x = i
c.z = f
i.o = d
i.t = d
i.u = l
i.v = l
i.w = f
i.p = f
l.t = d
l.r = f
k.u = l
k.o = l
k.x = i
k.z = f
assert i.v.r.z.w.y.r.z.txt == "i"