class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: E = None
        self.y: F = None
        self.t: E = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.p: F = None
        self.y: D = None
        self.u: A = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: B = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.p: F = None
        self.y: D = None
        self.u: A = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: B = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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