class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: G = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: G = None
        self.r: A = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.s: G = None
        self.w: F = None
        self.o: C = None
        self.p: G = None
        self.txt = txt

g = A("g")
l = B("l")
c = C("c")
j = D("j")
e = E("e")
a = F("a")
h = G("h")
b = H("b")

g.q = h
g.w = h
g.s = j
l.q = g
l.w = e
c.x = h
c.r = e
c.v = g
c.w = g
j.y = c
e.x = l
e.t = l
e.u = g
e.s = g
e.o = a
e.p = h
a.y = c
a.z = h
a.p = h
a.r = g
h.t = e
h.q = a
h.v = g
h.y = g
b.x = g
b.u = c
b.o = c
b.s = h
b.p = h
b.w = a
assert a.p.v.s.y.v.w.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: G = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: G = None
        self.r: A = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.s: G = None
        self.w: F = None
        self.o: C = None
        self.p: G = None
        self.txt = txt

g = A("g")
l = B("l")
c = C("c")
j = D("j")
e = E("e")
a = F("a")
h = G("h")
b = H("b")

g.q = h
g.w = h
g.s = j
l.q = g
l.w = e
c.x = h
c.r = e
c.v = g
c.w = g
j.y = c
e.x = l
e.t = l
e.u = g
e.s = g
e.o = a
e.p = h
a.y = c
a.z = h
a.p = h
a.r = g
h.t = e
h.q = a
h.v = g
h.y = g
b.x = g
b.u = c
b.o = c
b.s = h
b.p = h
b.w = a
assert a.p.v.s.y.v.w.y.s.txt == "j"