class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.z: A = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.y: D = None
        self.s: D = None
        self.txt = txt

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

f = A("f")
l = B("l")
b = C("b")
m = D("m")
c = D("c")
n = B("n")
h = D("h")
d = A("d")
e = C("e")
k = D("k")

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: D = None
        self.y: D = None
        self.s: D = None
        self.txt = txt

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

f = A("f")
l = B("l")
b = C("b")
m = D("m")
c = D("c")
n = B("n")
h = D("h")
d = A("d")
e = C("e")
k = D("k")

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