class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

j = A("j")
e = B("e")
n = C("n")
c = D("c")
k = E("k")
h = F("h")
l = G("l")
i = C("i")

j.u = k
j.o = k
j.x = k
e.y = l
e.x = l
e.p = h
e.z = j
e.r = k
n.q = i
c.o = e
c.p = i
c.u = h
k.r = n
k.q = c
k.p = j
h.o = e
h.w = e
h.x = i
h.v = i
l.s = c
i.q = n
assert i.q.q.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

j = A("j")
e = B("e")
n = C("n")
c = D("c")
k = E("k")
h = F("h")
l = G("l")
i = C("i")

j.u = k
j.o = k
j.x = k
e.y = l
e.x = l
e.p = h
e.z = j
e.r = k
n.q = i
c.o = e
c.p = i
c.u = h
k.r = n
k.q = c
k.p = j
h.o = e
h.w = e
h.x = i
h.v = i
l.s = c
i.q = n
assert i.q.q.q.q.q.q.txt == "i"