class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: E = None
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: D = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: B = None
        self.r: D = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: D = None
        self.u: A = None
        self.o: B = None
        self.z: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: D = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: B = None
        self.r: D = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: D = None
        self.u: A = None
        self.o: B = None
        self.z: F = None
        self.w: A = None
        self.txt = txt

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

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