class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: F = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: G = None
        self.y: D = None
        self.txt = txt

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

h = A("h")
d = B("d")
a = C("a")
m = D("m")
l = E("l")
k = F("k")
c = G("c")
i = E("i")

h.s = a
h.v = a
h.w = k
d.t = a
d.v = a
d.y = k
a.t = m
a.y = k
a.o = d
m.u = l
l.x = c
l.o = k
l.z = h
l.q = d
k.w = a
k.z = c
k.y = m
c.w = a
c.q = m
c.z = d
c.t = d
c.v = k
c.o = h
i.x = c
i.o = k
i.z = h
i.q = d
assert a.t.u.q.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: F = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: G = None
        self.y: D = None
        self.txt = txt

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

h = A("h")
d = B("d")
a = C("a")
m = D("m")
l = E("l")
k = F("k")
c = G("c")
i = E("i")

h.s = a
h.v = a
h.w = k
d.t = a
d.v = a
d.y = k
a.t = m
a.y = k
a.o = d
m.u = l
l.x = c
l.o = k
l.z = h
l.q = d
k.w = a
k.z = c
k.y = m
c.w = a
c.q = m
c.z = d
c.t = d
c.v = k
c.o = h
i.x = c
i.o = k
i.z = h
i.q = d
assert a.t.u.q.t.o.txt == "d"