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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
a = C("a")
n = D("n")
m = E("m")
d = F("d")

c.v = m
c.y = m
l.o = d
l.y = m
l.p = m
l.t = c
a.u = m
n.v = l
n.x = c
n.r = m
m.z = a
d.s = a
d.v = a
d.o = c
d.q = m
d.u = l
d.z = l
assert n.r.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
a = C("a")
n = D("n")
m = E("m")
d = F("d")

c.v = m
c.y = m
l.o = d
l.y = m
l.p = m
l.t = c
a.u = m
n.v = l
n.x = c
n.r = m
m.z = a
d.s = a
d.v = a
d.o = c
d.q = m
d.u = l
d.z = l
assert n.r.z.u.z.txt == "a"