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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.w: B = None
        self.y: E = None
        self.o: F = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: E = None
        self.r: A = None
        self.q: E = None
        self.x: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: E = None
        self.w: B = None
        self.y: E = None
        self.o: F = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: E = None
        self.r: A = None
        self.q: E = None
        self.x: E = None
        self.p: A = None
        self.txt = txt

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

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