class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.u: C = None
        self.y: E = None
        self.p: E = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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