class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: H = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

d = A("d")
l = B("l")
a = C("a")
e = D("e")
c = E("c")
j = F("j")
h = G("h")
i = H("i")
g = H("g")
m = C("m")

d.x = h
l.y = a
l.o = d
l.s = e
a.u = m
e.o = d
e.v = c
c.w = m
c.x = j
j.x = c
j.r = e
j.q = a
h.u = c
h.v = i
h.s = j
i.v = e
g.v = e
m.u = a
assert a.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: H = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

d = A("d")
l = B("l")
a = C("a")
e = D("e")
c = E("c")
j = F("j")
h = G("h")
i = H("i")
g = H("g")
m = C("m")

d.x = h
l.y = a
l.o = d
l.s = e
a.u = m
e.o = d
e.v = c
c.w = m
c.x = j
j.x = c
j.r = e
j.q = a
h.u = c
h.v = i
h.s = j
i.v = e
g.v = e
m.u = a
assert a.u.u.u.txt == "m"