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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: C = None
        self.y: E = None
        self.z: A = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: C = None
        self.y: E = None
        self.z: A = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

i.r = e
b.r = l
b.w = l
b.v = l
b.t = e
b.y = g
b.z = d
e.o = g
e.s = g
e.r = k
e.w = k
l.s = b
l.w = e
g.x = k
g.y = k
g.r = i
k.p = l
k.v = l
k.t = i
k.x = e
k.r = e
d.r = e
f.r = l
f.w = l
f.v = l
f.t = e
f.y = g
f.z = d
assert b.y.y.t.r.w.t.txt == "i"