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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: B = None
        self.t: C = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.q: G = None
        self.z: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: B = None
        self.t: C = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.q: G = None
        self.z: E = None
        self.v: C = None
        self.txt = txt

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

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

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