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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: B = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: E = None
        self.y: F = None
        self.t: B = None
        self.q: G = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: B = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: E = None
        self.y: F = None
        self.t: B = None
        self.q: G = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

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

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

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