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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: G = None
        self.w: E = None
        self.o: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: G = None
        self.w: E = None
        self.o: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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