class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: E = None
        self.x: F = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.y: B = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.y: B = None
        self.s: F = None
        self.txt = txt

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

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

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

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

m.q = j
m.w = j
m.x = i
m.p = b
k.v = j
k.u = j
b.o = j
b.u = m
b.y = k
b.s = i
n.w = k
n.q = b
j.z = m
j.t = i
i.u = k
assert n.q.y.v.z.x.u.txt == "k"