class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.u: D = None
        self.x: B = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.z: A = None
        self.s: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: D = None
        self.t: D = None
        self.txt = txt

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

i = A("i")
g = B("g")
h = C("h")
l = D("l")
f = E("f")
d = F("d")

i.r = l
i.u = l
i.v = g
i.x = g
i.t = d
g.r = l
h.w = g
l.o = f
l.q = f
l.t = h
l.z = i
l.s = i
f.z = h
f.u = l
f.t = l
d.w = l
d.q = l
d.v = g
d.t = f
d.p = f
d.s = i
assert i.v.r.t.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.u: D = None
        self.x: B = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.z: A = None
        self.s: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: D = None
        self.t: D = None
        self.txt = txt

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

i = A("i")
g = B("g")
h = C("h")
l = D("l")
f = E("f")
d = F("d")

i.r = l
i.u = l
i.v = g
i.x = g
i.t = d
g.r = l
h.w = g
l.o = f
l.q = f
l.t = h
l.z = i
l.s = i
f.z = h
f.u = l
f.t = l
d.w = l
d.q = l
d.v = g
d.t = f
d.p = f
d.s = i
assert i.v.r.t.w.r.txt == "l"