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

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

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

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

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

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

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

b.q = m
b.v = j
k.s = b
j.z = m
j.s = c
j.r = n
n.o = c
n.t = c
n.s = m
m.x = k
c.o = j
c.y = j
assert m.x.s.v.z.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

b.q = m
b.v = j
k.s = b
j.z = m
j.s = c
j.r = n
n.o = c
n.t = c
n.s = m
m.x = k
c.o = j
c.y = j
assert m.x.s.v.z.x.s.txt == "b"