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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

b.x = g
b.o = f
b.r = k
b.q = k
b.v = d
d.x = h
d.s = h
d.u = e
f.u = g
f.y = h
f.q = e
f.x = e
k.r = d
k.p = d
k.o = g
i.q = h
i.r = g
h.s = k
h.o = k
h.p = d
h.t = f
g.q = e
g.p = f
g.r = f
g.w = d
e.q = h
e.r = g
m.x = g
m.o = f
m.r = k
m.q = k
m.v = d
assert d.u.r.w.u.r.q.q.txt == "h"