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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: C = None
        self.z: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: C = None
        self.z: B = None
        self.v: C = None
        self.txt = txt

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

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

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

m.u = k
m.y = k
m.r = k
m.w = j
m.q = c
n.t = k
n.x = k
n.u = c
n.z = c
n.v = c
n.w = m
k.u = m
k.t = j
k.o = c
k.r = c
k.w = c
l.u = n
l.z = n
l.t = k
l.v = k
c.r = m
c.z = n
j.o = l
assert j.o.u.w.w.o.z.txt == "n"