class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: E = None
        self.x: E = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: C = None
        self.t: A = None
        self.u: C = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
e = C("e")
d = D("d")
m = E("m")
n = F("n")
b = G("b")
a = A("a")
c = C("c")
i = A("i")

k.s = l
l.y = c
l.s = n
e.w = l
e.t = m
e.x = m
e.u = d
d.u = b
m.r = l
m.y = c
m.t = k
m.u = e
n.r = m
n.p = d
n.u = b
b.x = e
b.u = m
b.t = m
b.q = m
b.v = n
b.r = d
b.s = k
a.s = l
c.w = l
c.t = m
c.x = m
c.u = d
i.s = l
assert d.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: E = None
        self.x: E = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: C = None
        self.t: A = None
        self.u: C = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
e = C("e")
d = D("d")
m = E("m")
n = F("n")
b = G("b")
a = A("a")
c = C("c")
i = A("i")

k.s = l
l.y = c
l.s = n
e.w = l
e.t = m
e.x = m
e.u = d
d.u = b
m.r = l
m.y = c
m.t = k
m.u = e
n.r = m
n.p = d
n.u = b
b.x = e
b.u = m
b.t = m
b.q = m
b.v = n
b.r = d
b.s = k
a.s = l
c.w = l
c.t = m
c.x = m
c.u = d
i.s = l
assert d.u.v.u.txt == "b"