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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.y: F = None
        self.v: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

d = A("d")
i = B("i")
b = C("b")
l = D("l")
h = E("h")
e = F("e")
n = B("n")
j = A("j")
a = A("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: F = None
        self.y: F = None
        self.v: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

d = A("d")
i = B("i")
b = C("b")
l = D("l")
h = E("h")
e = F("e")
n = B("n")
j = A("j")
a = A("a")

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