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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.x: A = None
        self.y: E = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: A = None
        self.w: D = None
        self.o: B = None
        self.z: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.x: A = None
        self.y: E = None
        self.s: A = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: A = None
        self.w: D = None
        self.o: B = None
        self.z: A = None
        self.txt = txt

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

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