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

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

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

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

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

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

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

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

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

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

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

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

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

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

f.r = k
k.o = b
k.v = b
k.x = a
k.y = l
k.t = f
n.r = l
n.x = a
n.z = b
n.w = f
a.o = b
a.r = b
b.v = j
b.s = a
b.u = f
j.w = b
j.o = f
j.u = f
j.y = n
j.p = k
j.z = a
m.w = b
m.o = f
m.u = f
m.y = n
m.p = k
m.z = a
l.o = b
l.v = b
l.x = a
l.y = k
l.t = f
assert j.p.x.o.txt == "b"