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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.r: G = None
        self.o: H = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: G = None
        self.s: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: A = None
        self.txt = txt

c = A("c")
j = B("j")
g = C("g")
d = D("d")
m = E("m")
f = F("f")
i = G("i")
e = H("e")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.r: G = None
        self.o: H = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: G = None
        self.s: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: A = None
        self.txt = txt

c = A("c")
j = B("j")
g = C("g")
d = D("d")
m = E("m")
f = F("f")
i = G("i")
e = H("e")
a = F("a")

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