class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: H = None
        self.s: E = None
        self.x: C = None
        self.z: D = None
        self.r: H = None
        self.u: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: C = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: C = None
        self.u: G = None
        self.s: B = None
        self.r: C = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.txt = txt

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

h = A("h")
d = B("d")
f = C("f")
e = D("e")
i = E("i")
l = F("l")
b = G("b")
g = H("g")
c = D("c")

h.q = g
h.v = g
h.r = g
h.s = i
h.u = i
h.x = f
h.z = c
h.o = l
d.w = g
d.x = f
d.s = l
f.v = d
f.z = d
f.t = l
e.v = c
e.y = b
e.t = f
e.r = l
e.w = g
e.o = h
i.q = g
i.w = f
i.o = h
l.t = b
l.u = b
l.w = f
l.r = f
l.z = f
l.s = d
l.y = i
b.x = d
b.z = d
g.o = h
g.q = h
g.r = h
g.y = l
g.v = f
g.z = b
c.v = e
c.y = b
c.t = f
c.r = l
c.w = g
c.o = h
assert d.x.t.t.x.w.v.v.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: H = None
        self.s: E = None
        self.x: C = None
        self.z: D = None
        self.r: H = None
        self.u: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: C = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: C = None
        self.u: G = None
        self.s: B = None
        self.r: C = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.txt = txt

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

h = A("h")
d = B("d")
f = C("f")
e = D("e")
i = E("i")
l = F("l")
b = G("b")
g = H("g")
c = D("c")

h.q = g
h.v = g
h.r = g
h.s = i
h.u = i
h.x = f
h.z = c
h.o = l
d.w = g
d.x = f
d.s = l
f.v = d
f.z = d
f.t = l
e.v = c
e.y = b
e.t = f
e.r = l
e.w = g
e.o = h
i.q = g
i.w = f
i.o = h
l.t = b
l.u = b
l.w = f
l.r = f
l.z = f
l.s = d
l.y = i
b.x = d
b.z = d
g.o = h
g.q = h
g.r = h
g.y = l
g.v = f
g.z = b
c.v = e
c.y = b
c.t = f
c.r = l
c.w = g
c.o = h
assert d.x.t.t.x.w.v.v.w.z.txt == "b"