class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: G = None
        self.q: C = None
        self.s: F = None
        self.o: B = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: D = None
        self.z: G = None
        self.s: C = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: B = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: E = None
        self.q: C = None
        self.o: D = None
        self.x: A = None
        self.w: H = None
        self.v: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: F = None
        self.z: G = None
        self.s: B = None
        self.u: B = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

g = A("g")
b = B("b")
h = C("h")
m = D("m")
c = E("c")
e = F("e")
f = G("f")
l = H("l")

g.u = f
g.z = f
g.q = h
g.v = h
g.s = e
g.o = b
g.p = c
b.t = c
b.x = m
b.w = m
b.z = f
b.s = h
h.u = l
h.o = b
h.v = f
m.v = g
m.q = e
m.y = c
m.p = b
c.r = h
c.p = l
c.q = g
c.o = g
c.v = e
c.z = b
e.t = f
e.v = f
e.y = c
e.q = h
e.o = m
e.x = g
e.w = l
f.r = e
f.o = m
f.t = l
l.p = h
l.v = e
l.z = f
l.s = b
l.u = b
l.q = c
l.x = m
assert l.x.q.x.p.q.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: G = None
        self.q: C = None
        self.s: F = None
        self.o: B = None
        self.v: C = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: D = None
        self.z: G = None
        self.s: C = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: B = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: E = None
        self.q: C = None
        self.o: D = None
        self.x: A = None
        self.w: H = None
        self.v: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: F = None
        self.z: G = None
        self.s: B = None
        self.u: B = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

g = A("g")
b = B("b")
h = C("h")
m = D("m")
c = E("c")
e = F("e")
f = G("f")
l = H("l")

g.u = f
g.z = f
g.q = h
g.v = h
g.s = e
g.o = b
g.p = c
b.t = c
b.x = m
b.w = m
b.z = f
b.s = h
h.u = l
h.o = b
h.v = f
m.v = g
m.q = e
m.y = c
m.p = b
c.r = h
c.p = l
c.q = g
c.o = g
c.v = e
c.z = b
e.t = f
e.v = f
e.y = c
e.q = h
e.o = m
e.x = g
e.w = l
f.r = e
f.o = m
f.t = l
l.p = h
l.v = e
l.z = f
l.s = b
l.u = b
l.q = c
l.x = m
assert l.x.q.x.p.q.o.z.txt == "f"