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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: H = None
        self.u: F = None
        self.v: D = None
        self.p: F = None
        self.s: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: B = None
        self.r: F = None
        self.w: E = None
        self.x: D = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.x: A = None
        self.y: E = None
        self.z: D = None
        self.t: E = None
        self.u: E = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

c = A("c")
i = B("i")
m = C("m")
a = D("a")
g = E("g")
f = F("f")
n = G("n")
b = H("b")

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: H = None
        self.u: F = None
        self.v: D = None
        self.p: F = None
        self.s: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: B = None
        self.r: F = None
        self.w: E = None
        self.x: D = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.x: A = None
        self.y: E = None
        self.z: D = None
        self.t: E = None
        self.u: E = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

c = A("c")
i = B("i")
m = C("m")
a = D("a")
g = E("g")
f = F("f")
n = G("n")
b = H("b")

c.q = g
c.p = m
c.u = f
i.o = n
i.y = b
i.u = f
i.p = f
i.s = f
i.v = a
i.r = c
m.u = g
m.w = g
m.y = i
m.r = f
m.x = a
m.z = n
a.o = g
a.u = c
a.r = n
g.y = f
g.w = f
g.s = b
g.z = c
g.q = c
f.w = b
f.s = g
f.y = g
f.t = g
f.u = g
f.x = c
f.z = a
f.r = a
n.q = f
b.q = m
b.r = c
b.v = g
assert m.z.q.x.u.txt == "f"