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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: C = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.q: F = None
        self.p: A = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

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

b = A("b")
e = B("e")
l = C("l")
h = D("h")
f = E("f")
d = F("d")
g = G("g")
j = F("j")
n = C("n")

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

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

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: C = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.q: F = None
        self.p: A = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

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

b = A("b")
e = B("e")
l = C("l")
h = D("h")
f = E("f")
d = F("d")
g = G("g")
j = F("j")
n = C("n")

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