class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.o: B = None
        self.t: A = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.o: B = None
        self.t: A = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

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

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