class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

e = A("e")
a = B("a")
k = C("k")
g = D("g")
j = E("j")
m = F("m")
l = D("l")

e.v = j
e.q = j
e.u = a
a.r = j
a.w = j
a.p = m
k.p = m
k.y = e
g.p = a
j.y = m
j.v = m
j.r = e
j.o = e
j.x = a
j.p = k
m.o = l
l.p = a
assert l.p.w.y.o.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

e = A("e")
a = B("a")
k = C("k")
g = D("g")
j = E("j")
m = F("m")
l = D("l")

e.v = j
e.q = j
e.u = a
a.r = j
a.w = j
a.p = m
k.p = m
k.y = e
g.p = a
j.y = m
j.v = m
j.r = e
j.o = e
j.x = a
j.p = k
m.o = l
l.p = a
assert l.p.w.y.o.p.w.txt == "j"