class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.r: B = None
        self.v: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.z: B = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.z: B = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: E = None
        self.txt = txt

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

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

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