class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: G = None
        self.w: F = None
        self.v: C = None
        self.z: C = None
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: F = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.txt = txt

g = A("g")
e = B("e")
f = C("f")
h = D("h")
j = E("j")
k = F("k")
m = G("m")
a = H("a")

g.p = k
g.w = k
g.o = m
g.x = m
g.v = f
g.z = f
e.p = j
e.o = j
e.r = k
e.x = f
e.w = m
e.y = h
f.p = j
h.q = f
h.s = f
h.w = k
j.r = h
j.p = m
k.p = e
k.y = a
m.q = j
m.z = g
m.u = h
a.r = j
a.x = m
assert h.w.y.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: G = None
        self.w: F = None
        self.v: C = None
        self.z: C = None
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: F = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.txt = txt

g = A("g")
e = B("e")
f = C("f")
h = D("h")
j = E("j")
k = F("k")
m = G("m")
a = H("a")

g.p = k
g.w = k
g.o = m
g.x = m
g.v = f
g.z = f
e.p = j
e.o = j
e.r = k
e.x = f
e.w = m
e.y = h
f.p = j
h.q = f
h.s = f
h.w = k
j.r = h
j.p = m
k.p = e
k.y = a
m.q = j
m.z = g
m.u = h
a.r = j
a.x = m
assert h.w.y.r.p.txt == "m"