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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: A = None
        self.w: A = None
        self.p: E = None
        self.q: D = None
        self.x: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: A = None
        self.w: A = None
        self.p: E = None
        self.q: D = None
        self.x: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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