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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.s: G = None
        self.r: A = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.q: G = None
        self.s: D = None
        self.x: D = None
        self.txt = txt

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

g = A("g")
c = B("c")
m = C("m")
k = D("k")
h = E("h")
i = F("i")
d = G("d")

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: D = None
        self.s: G = None
        self.r: A = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.q: G = None
        self.s: D = None
        self.x: D = None
        self.txt = txt

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

g = A("g")
c = B("c")
m = C("m")
k = D("k")
h = E("h")
i = F("i")
d = G("d")

g.p = i
g.s = i
g.z = k
g.y = k
g.x = h
g.o = d
g.r = c
c.o = d
c.p = g
m.z = k
m.o = k
m.s = d
m.w = d
m.r = g
m.u = g
k.o = m
k.p = m
k.q = c
k.y = g
k.w = d
h.w = d
h.v = k
h.s = g
h.y = c
h.q = m
i.v = h
i.t = c
i.q = d
i.s = k
i.x = k
d.r = h
d.s = c
assert h.v.o.s.r.txt == "h"