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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: F = None
        self.u: E = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.txt = txt

l = A("l")
k = B("k")
m = C("m")
n = D("n")
f = E("f")
j = F("j")
a = E("a")
c = D("c")

l.v = m
k.s = a
k.u = a
k.y = j
k.o = m
k.w = m
m.r = n
m.t = j
m.v = c
n.x = k
n.y = c
f.o = l
f.t = a
j.y = c
j.t = m
a.o = l
a.t = f
c.x = k
c.y = n
assert j.y.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: F = None
        self.u: E = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.txt = txt

l = A("l")
k = B("k")
m = C("m")
n = D("n")
f = E("f")
j = F("j")
a = E("a")
c = D("c")

l.v = m
k.s = a
k.u = a
k.y = j
k.o = m
k.w = m
m.r = n
m.t = j
m.v = c
n.x = k
n.y = c
f.o = l
f.t = a
j.y = c
j.t = m
a.o = l
a.t = f
c.x = k
c.y = n
assert j.y.y.x.txt == "k"