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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: G = None
        self.v: A = None
        self.z: A = None
        self.q: C = None
        self.r: E = None
        self.p: G = None
        self.txt = txt

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

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

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

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

h.q = l
h.o = l
h.w = l
h.s = c
l.u = h
m.q = a
d.x = i
d.w = i
d.p = i
d.v = h
d.z = j
d.q = m
d.r = c
c.p = j
c.u = d
c.s = h
c.r = i
c.y = i
c.q = l
a.s = d
a.q = i
a.u = c
i.v = c
j.q = l
j.o = l
j.w = l
j.s = c
assert h.s.s.q.u.o.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.s: E = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: G = None
        self.v: A = None
        self.z: A = None
        self.q: C = None
        self.r: E = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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