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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.z: B = None
        self.txt = txt

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

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

j.z = g
j.u = g
f.o = l
f.v = m
g.p = m
g.w = m
g.t = l
g.o = f
g.q = i
i.v = l
i.r = l
m.s = g
m.p = g
m.z = f
l.y = i
l.t = i
l.p = m
l.v = m
assert j.z.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.z: B = None
        self.txt = txt

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

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

j.z = g
j.u = g
f.o = l
f.v = m
g.p = m
g.w = m
g.t = l
g.o = f
g.q = i
i.v = l
i.r = l
m.s = g
m.p = g
m.z = f
l.y = i
l.t = i
l.p = m
l.v = m
assert j.z.p.s.txt == "g"