class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

b = A("b")
f = B("f")
k = C("k")
a = D("a")
g = E("g")
l = F("l")

b.v = g
b.o = g
b.u = k
b.r = a
f.z = l
f.y = a
f.w = b
k.u = l
k.p = g
a.u = g
g.o = f
g.p = f
g.t = k
g.u = b
l.t = b
assert l.t.u.u.t.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

b = A("b")
f = B("f")
k = C("k")
a = D("a")
g = E("g")
l = F("l")

b.v = g
b.o = g
b.u = k
b.r = a
f.z = l
f.y = a
f.w = b
k.u = l
k.p = g
a.u = g
g.o = f
g.p = f
g.t = k
g.u = b
l.t = b
assert l.t.u.u.t.u.u.txt == "l"