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

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

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

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

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

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

f = A("f")
n = B("n")
a = C("a")
i = D("i")
g = E("g")
j = F("j")
l = B("l")

f.r = j
f.z = a
n.o = f
n.r = l
n.p = j
n.v = j
a.x = l
a.p = l
a.q = l
i.y = g
i.w = j
i.v = j
g.q = j
g.p = j
g.x = j
g.r = a
j.v = a
j.r = l
l.o = f
l.r = n
l.p = j
l.v = j
assert j.v.x.o.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

f = A("f")
n = B("n")
a = C("a")
i = D("i")
g = E("g")
j = F("j")
l = B("l")

f.r = j
f.z = a
n.o = f
n.r = l
n.p = j
n.v = j
a.x = l
a.p = l
a.q = l
i.y = g
i.w = j
i.v = j
g.q = j
g.p = j
g.x = j
g.r = a
j.v = a
j.r = l
l.o = f
l.r = n
l.p = j
l.v = j
assert j.v.x.o.r.r.txt == "l"