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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: F = None
        self.v: D = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: F = None
        self.v: D = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

f.v = j
f.w = j
f.o = d
j.x = f
j.w = f
j.t = n
j.z = n
j.v = b
j.o = b
d.v = l
d.p = f
k.s = l
k.x = n
n.t = f
n.z = f
n.q = l
n.v = k
n.p = k
l.q = d
l.y = d
b.x = f
b.w = f
b.t = n
b.z = n
b.v = j
b.o = j
assert n.q.q.p.txt == "f"