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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.o: A = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

l = A("l")
c = B("c")
d = C("d")
g = D("g")
e = E("e")
k = F("k")
j = B("j")
m = A("m")
n = B("n")
h = A("h")

l.r = h
l.z = g
l.v = n
c.x = l
c.r = g
c.z = g
d.o = c
g.u = m
e.v = d
e.z = d
e.u = k
e.y = n
e.w = g
k.s = e
k.q = e
k.x = e
k.o = m
k.r = d
j.x = h
j.r = g
j.z = g
m.r = l
m.z = g
m.v = c
n.x = m
n.r = g
n.z = g
h.r = m
h.z = g
h.v = n
assert n.z.u.z.u.v.z.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.o: A = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

l = A("l")
c = B("c")
d = C("d")
g = D("g")
e = E("e")
k = F("k")
j = B("j")
m = A("m")
n = B("n")
h = A("h")

l.r = h
l.z = g
l.v = n
c.x = l
c.r = g
c.z = g
d.o = c
g.u = m
e.v = d
e.z = d
e.u = k
e.y = n
e.w = g
k.s = e
k.q = e
k.x = e
k.o = m
k.r = d
j.x = h
j.r = g
j.z = g
m.r = l
m.z = g
m.v = c
n.x = m
n.r = g
n.z = g
h.r = m
h.z = g
h.v = n
assert n.z.u.z.u.v.z.u.r.txt == "l"