class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: G = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: E = None
        self.z: B = None
        self.x: B = None
        self.p: H = None
        self.t: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: F = None
        self.u: F = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

c = A("c")
i = B("i")
b = C("b")
n = D("n")
j = E("j")
g = F("g")
d = G("d")
h = H("h")

c.p = h
i.t = j
i.w = c
b.y = d
b.r = d
b.w = d
n.p = b
j.o = c
j.y = d
j.u = d
g.o = i
g.z = i
g.x = i
g.u = j
g.t = j
g.p = h
g.s = c
d.q = n
d.x = g
d.u = g
d.z = g
d.w = g
h.r = j
h.x = b
h.u = b
assert c.p.r.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: G = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: E = None
        self.z: B = None
        self.x: B = None
        self.p: H = None
        self.t: E = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: F = None
        self.u: F = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

c = A("c")
i = B("i")
b = C("b")
n = D("n")
j = E("j")
g = F("g")
d = G("d")
h = H("h")

c.p = h
i.t = j
i.w = c
b.y = d
b.r = d
b.w = d
n.p = b
j.o = c
j.y = d
j.u = d
g.o = i
g.z = i
g.x = i
g.u = j
g.t = j
g.p = h
g.s = c
d.q = n
d.x = g
d.u = g
d.z = g
d.w = g
h.r = j
h.x = b
h.u = b
assert c.p.r.y.u.txt == "g"