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

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

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

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

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

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

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

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

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

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

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

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

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

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

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