class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: H = None
        self.o: B = None
        self.w: F = None
        self.v: G = None
        self.r: B = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.r: A = None
        self.s: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.r: A = None
        self.s: G = None
        self.txt = txt

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

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