class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: D = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: D = None
        self.t: D = None
        self.z: G = None
        self.q: B = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.p: C = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: D = None
        self.t: D = None
        self.z: G = None
        self.q: B = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.p: C = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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