class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: B = None
        self.v: F = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

k.z = b
k.v = b
k.r = g
k.x = j
k.w = j
g.y = k
g.v = k
g.t = k
g.s = j
j.o = g
j.z = k
a.x = m
a.o = k
a.q = b
a.t = l
m.z = l
m.y = j
m.o = b
b.r = k
l.x = m
l.o = k
l.q = b
l.t = a
assert l.x.z.x.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: B = None
        self.v: F = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.s: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

k.z = b
k.v = b
k.r = g
k.x = j
k.w = j
g.y = k
g.v = k
g.t = k
g.s = j
j.o = g
j.z = k
a.x = m
a.o = k
a.q = b
a.t = l
m.z = l
m.y = j
m.o = b
b.r = k
l.x = m
l.o = k
l.q = b
l.t = a
assert l.x.z.x.y.z.txt == "k"