class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.w: E = None
        self.o: G = None
        self.u: C = None
        self.s: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.v: C = None
        self.w: H = None
        self.s: D = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: G = None
        self.txt = txt

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

i.t = a
i.q = j
m.r = a
m.p = a
m.s = a
m.w = d
m.o = e
m.u = j
j.y = d
g.y = m
g.q = i
d.y = m
d.v = m
d.x = i
f.y = d
f.t = d
f.r = g
f.s = g
f.v = j
f.w = a
f.q = a
e.q = j
e.s = f
a.o = e
a.p = e
assert e.q.y.x.q.y.x.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: H = None
        self.w: E = None
        self.o: G = None
        self.u: C = None
        self.s: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.v: C = None
        self.w: H = None
        self.s: D = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: G = None
        self.txt = txt

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

i.t = a
i.q = j
m.r = a
m.p = a
m.s = a
m.w = d
m.o = e
m.u = j
j.y = d
g.y = m
g.q = i
d.y = m
d.v = m
d.x = i
f.y = d
f.t = d
f.r = g
f.s = g
f.v = j
f.w = a
f.q = a
e.q = j
e.s = f
a.o = e
a.p = e
assert e.q.y.x.q.y.x.q.y.txt == "d"