class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: D = None
        self.x: G = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: D = None
        self.q: D = None
        self.t: E = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: D = None
        self.q: D = None
        self.t: E = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: D = None
        self.txt = txt

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

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