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

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

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

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

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

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

c = A("c")
f = B("f")
a = C("a")
g = D("g")
n = E("n")
j = F("j")
b = D("b")
d = B("d")
l = C("l")

c.v = b
f.q = c
f.t = c
f.o = a
f.x = d
f.u = l
a.q = g
a.r = l
a.z = l
g.y = j
g.z = c
g.x = c
g.u = l
n.v = l
j.u = n
b.y = j
b.z = c
b.x = c
b.u = a
d.q = c
d.t = c
d.o = a
d.u = a
d.x = f
l.q = g
l.r = a
l.z = a
assert c.v.u.z.q.y.u.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

c = A("c")
f = B("f")
a = C("a")
g = D("g")
n = E("n")
j = F("j")
b = D("b")
d = B("d")
l = C("l")

c.v = b
f.q = c
f.t = c
f.o = a
f.x = d
f.u = l
a.q = g
a.r = l
a.z = l
g.y = j
g.z = c
g.x = c
g.u = l
n.v = l
j.u = n
b.y = j
b.z = c
b.x = c
b.u = a
d.q = c
d.t = c
d.o = a
d.u = a
d.x = f
l.q = g
l.r = a
l.z = a
assert c.v.u.z.q.y.u.v.r.txt == "a"