class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.p: F = None
        self.q: C = None
        self.s: G = None
        self.t: B = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: F = None
        self.r: D = None
        self.p: C = None
        self.txt = txt

f = A("f")
k = B("k")
n = C("n")
m = D("m")
g = E("g")
l = F("l")
h = G("h")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: F = None
        self.r: D = None
        self.p: C = None
        self.txt = txt

f = A("f")
k = B("k")
n = C("n")
m = D("m")
g = E("g")
l = F("l")
h = G("h")

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