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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: F = None
        self.w: F = 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.o: G = None
        self.t: A = None
        self.p: A = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: F = None
        self.w: F = 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.o: G = None
        self.t: A = None
        self.p: A = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

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

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