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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.txt = txt

g = A("g")
i = B("i")
d = C("d")
b = D("b")
a = E("a")
l = F("l")
h = A("h")
m = E("m")
j = B("j")

g.z = d
g.q = d
g.u = d
g.t = i
i.u = g
i.r = j
i.t = h
i.p = l
d.z = b
b.s = g
a.s = d
a.p = i
l.u = g
l.w = h
h.z = d
h.q = d
h.u = d
h.t = j
m.s = d
m.p = j
j.u = g
j.t = g
j.r = i
j.p = l
assert j.t.z.z.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.u: C = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.txt = txt

g = A("g")
i = B("i")
d = C("d")
b = D("b")
a = E("a")
l = F("l")
h = A("h")
m = E("m")
j = B("j")

g.z = d
g.q = d
g.u = d
g.t = i
i.u = g
i.r = j
i.t = h
i.p = l
d.z = b
b.s = g
a.s = d
a.p = i
l.u = g
l.w = h
h.z = d
h.q = d
h.u = d
h.t = j
m.s = d
m.p = j
j.u = g
j.t = g
j.r = i
j.p = l
assert j.t.z.z.s.t.txt == "i"