class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.r: E = None
        self.s: E = None
        self.txt = txt

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

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

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

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

h = A("h")
d = B("d")
l = C("l")
f = D("f")
i = E("i")
b = F("b")
n = C("n")
e = A("e")
j = A("j")

h.r = n
d.y = b
d.x = j
d.r = i
d.s = i
l.q = n
l.o = b
l.s = f
l.u = d
l.x = e
l.z = j
f.z = l
f.o = d
f.y = i
f.q = b
i.o = b
i.v = h
i.y = d
b.y = h
b.w = n
b.v = n
b.p = i
b.u = f
b.z = d
n.q = l
n.o = b
n.s = f
n.u = d
n.x = h
n.z = j
e.r = n
j.r = l
assert e.r.o.z.x.r.x.r.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.r: E = None
        self.s: E = None
        self.txt = txt

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

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

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

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

h = A("h")
d = B("d")
l = C("l")
f = D("f")
i = E("i")
b = F("b")
n = C("n")
e = A("e")
j = A("j")

h.r = n
d.y = b
d.x = j
d.r = i
d.s = i
l.q = n
l.o = b
l.s = f
l.u = d
l.x = e
l.z = j
f.z = l
f.o = d
f.y = i
f.q = b
i.o = b
i.v = h
i.y = d
b.y = h
b.w = n
b.v = n
b.p = i
b.u = f
b.z = d
n.q = l
n.o = b
n.s = f
n.u = d
n.x = h
n.z = j
e.r = n
j.r = l
assert e.r.o.z.x.r.x.r.o.v.txt == "n"