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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: F = None
        self.o: E = None
        self.r: B = None
        self.w: F = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

k = A("k")
i = B("i")
a = C("a")
d = D("d")
g = E("g")
h = F("h")
c = G("c")
j = C("j")
n = B("n")

k.z = n
k.t = d
k.x = h
k.w = a
k.r = c
i.y = d
i.s = n
i.u = g
a.r = n
d.q = a
d.s = g
d.u = h
g.x = j
g.y = n
h.s = g
c.q = i
c.r = i
c.u = h
c.w = h
c.o = g
c.z = n
c.t = k
j.r = n
n.y = d
n.s = i
n.u = g
assert a.r.u.x.r.s.u.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.x: F = None
        self.w: C = None
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: F = None
        self.o: E = None
        self.r: B = None
        self.w: F = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

k = A("k")
i = B("i")
a = C("a")
d = D("d")
g = E("g")
h = F("h")
c = G("c")
j = C("j")
n = B("n")

k.z = n
k.t = d
k.x = h
k.w = a
k.r = c
i.y = d
i.s = n
i.u = g
a.r = n
d.q = a
d.s = g
d.u = h
g.x = j
g.y = n
h.s = g
c.q = i
c.r = i
c.u = h
c.w = h
c.o = g
c.z = n
c.t = k
j.r = n
n.y = d
n.s = i
n.u = g
assert a.r.u.x.r.s.u.y.s.y.txt == "d"