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

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

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

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

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

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

l = A("l")
e = B("e")
f = C("f")
j = D("j")
i = E("i")
c = F("c")

l.v = c
l.q = f
l.z = f
l.y = i
e.o = i
f.r = c
f.q = c
f.w = c
j.r = c
j.v = c
j.o = i
j.x = l
j.y = f
i.z = f
i.y = l
c.s = l
c.y = l
c.w = l
c.z = e
c.r = i
c.q = j
assert f.r.q.y.r.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: C = None
        self.y: E = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

l = A("l")
e = B("e")
f = C("f")
j = D("j")
i = E("i")
c = F("c")

l.v = c
l.q = f
l.z = f
l.y = i
e.o = i
f.r = c
f.q = c
f.w = c
j.r = c
j.v = c
j.o = i
j.x = l
j.y = f
i.z = f
i.y = l
c.s = l
c.y = l
c.w = l
c.z = e
c.r = i
c.q = j
assert f.r.q.y.r.y.v.txt == "c"