class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: F = None
        self.r: F = None
        self.o: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: A = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.u: E = None
        self.s: D = None
        self.z: E = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
d = C("d")
e = D("e")
m = E("m")
b = F("b")
n = D("n")

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: A = None
        self.q: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.u: E = None
        self.s: D = None
        self.z: E = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
d = C("d")
e = D("e")
m = E("m")
b = F("b")
n = D("n")

f.v = j
f.s = j
f.q = b
f.r = b
f.o = d
j.v = b
j.y = m
d.t = j
d.x = j
d.s = f
d.q = n
e.y = d
e.x = f
e.u = m
e.z = m
e.s = n
m.r = f
m.w = j
m.v = d
b.p = f
n.y = d
n.x = f
n.u = m
n.z = m
n.s = e
assert m.w.v.p.txt == "f"