class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: D = None
        self.x: D = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.s: E = None
        self.u: D = None
        self.q: F = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: C = None
        self.s: E = None
        self.u: D = None
        self.q: F = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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