class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.t: H = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.p: B = None
        self.z: H = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: G = None
        self.z: B = None
        self.t: B = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: E = None
        self.p: B = None
        self.z: H = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: G = None
        self.z: B = None
        self.t: B = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

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