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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

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

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

j = A("j")
a = B("a")
n = C("n")
m = D("m")
g = E("g")
h = F("h")
b = C("b")
k = D("k")
e = B("e")

j.u = n
j.s = n
j.z = n
j.w = k
j.t = h
j.x = g
a.p = g
a.s = j
n.u = j
n.t = h
m.v = n
m.r = k
m.t = g
g.u = e
h.p = g
h.z = g
h.w = n
h.q = k
b.u = j
b.t = h
k.v = b
k.r = m
k.t = g
e.p = g
e.s = j
assert m.v.t.q.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: D = None
        self.s: C = None
        self.z: C = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

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

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

j = A("j")
a = B("a")
n = C("n")
m = D("m")
g = E("g")
h = F("h")
b = C("b")
k = D("k")
e = B("e")

j.u = n
j.s = n
j.z = n
j.w = k
j.t = h
j.x = g
a.p = g
a.s = j
n.u = j
n.t = h
m.v = n
m.r = k
m.t = g
g.u = e
h.p = g
h.z = g
h.w = n
h.q = k
b.u = j
b.t = h
k.v = b
k.r = m
k.t = g
e.p = g
e.s = j
assert m.v.t.q.r.r.txt == "k"