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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: A = None
        self.u: E = None
        self.q: C = None
        self.txt = txt

c = A("c")
k = B("k")
m = C("m")
b = D("b")
n = E("n")
e = F("e")

c.s = k
k.u = c
m.y = c
m.v = e
b.p = m
b.w = c
n.x = m
e.x = b
e.r = c
e.u = n
e.q = m
assert e.x.p.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: A = None
        self.u: E = None
        self.q: C = None
        self.txt = txt

c = A("c")
k = B("k")
m = C("m")
b = D("b")
n = E("n")
e = F("e")

c.s = k
k.u = c
m.y = c
m.v = e
b.p = m
b.w = c
n.x = m
e.x = b
e.r = c
e.u = n
e.q = m
assert e.x.p.v.r.txt == "c"