class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

k = A("k")
i = B("i")
l = C("l")
g = D("g")
f = E("f")
c = F("c")

k.u = i
k.x = g
k.o = g
i.y = f
l.o = c
l.r = c
l.y = g
l.x = f
g.o = i
f.y = k
f.v = k
f.s = k
f.o = l
c.p = i
assert g.o.y.s.u.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

k = A("k")
i = B("i")
l = C("l")
g = D("g")
f = E("f")
c = F("c")

k.u = i
k.x = g
k.o = g
i.y = f
l.o = c
l.r = c
l.y = g
l.x = f
g.o = i
f.y = k
f.v = k
f.s = k
f.o = l
c.p = i
assert g.o.y.s.u.y.o.txt == "l"