class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: F = None
        self.x: E = None
        self.s: E = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: B = None
        self.x: B = None
        self.y: D = None
        self.v: C = None
        self.txt = txt

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

f = A("f")
k = B("k")
l = C("l")
g = D("g")
n = E("n")
e = F("e")
a = E("a")
h = C("h")
b = A("b")
d = F("d")

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: F = None
        self.x: E = None
        self.s: E = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: B = None
        self.x: B = None
        self.y: D = None
        self.v: C = None
        self.txt = txt

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

f = A("f")
k = B("k")
l = C("l")
g = D("g")
n = E("n")
e = F("e")
a = E("a")
h = C("h")
b = A("b")
d = F("d")

f.p = l
f.t = b
f.s = b
f.v = b
k.u = g
l.y = n
l.x = n
l.v = e
l.s = a
l.z = k
g.u = f
g.z = l
n.z = e
n.r = k
n.x = k
n.y = g
n.v = l
e.y = k
e.u = d
a.z = d
a.r = k
a.x = k
a.y = g
a.v = l
h.y = a
h.x = a
h.s = a
h.v = e
h.z = k
b.p = h
b.t = f
b.s = f
b.v = f
d.y = k
d.u = e
assert h.v.u.u.y.u.z.z.u.txt == "g"