class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: C = None
        self.p: D = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: A = None
        self.s: F = None
        self.p: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.o: A = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.t: E = None
        self.w: B = None
        self.txt = txt

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

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

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

g.x = b
g.p = b
g.u = c
g.v = n
g.y = m
m.o = n
m.y = g
m.p = g
m.s = h
m.t = b
c.t = f
c.p = f
c.o = g
c.q = b
c.y = n
b.y = n
b.w = n
b.q = e
b.t = j
j.z = b
h.x = c
h.u = b
e.x = c
e.u = b
n.o = m
n.y = g
n.p = g
n.s = h
n.t = b
f.z = b
assert m.s.u.w.o.s.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: C = None
        self.p: D = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: A = None
        self.s: F = None
        self.p: A = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: E = None
        self.o: A = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: F = None
        self.t: E = None
        self.w: B = None
        self.txt = txt

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

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

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

g.x = b
g.p = b
g.u = c
g.v = n
g.y = m
m.o = n
m.y = g
m.p = g
m.s = h
m.t = b
c.t = f
c.p = f
c.o = g
c.q = b
c.y = n
b.y = n
b.w = n
b.q = e
b.t = j
j.z = b
h.x = c
h.u = b
e.x = c
e.u = b
n.o = m
n.y = g
n.p = g
n.s = h
n.t = b
f.z = b
assert m.s.u.w.o.s.u.q.txt == "e"