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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: E = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

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

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

l = A("l")
b = B("b")
n = C("n")
i = D("i")
g = E("g")
f = F("f")
a = G("a")
m = E("m")

l.x = g
l.v = g
l.r = g
l.o = g
l.w = b
l.u = i
l.q = a
b.s = f
n.q = l
i.v = l
g.s = n
g.z = m
g.w = f
g.r = l
f.o = l
f.r = a
a.q = g
a.x = l
m.s = n
m.z = g
m.w = f
m.r = l
assert m.w.o.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: B = None
        self.v: E = None
        self.u: D = None
        self.r: E = None
        self.q: G = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: E = None
        self.w: F = None
        self.r: A = None
        self.txt = txt

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

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

l = A("l")
b = B("b")
n = C("n")
i = D("i")
g = E("g")
f = F("f")
a = G("a")
m = E("m")

l.x = g
l.v = g
l.r = g
l.o = g
l.w = b
l.u = i
l.q = a
b.s = f
n.q = l
i.v = l
g.s = n
g.z = m
g.w = f
g.r = l
f.o = l
f.r = a
a.q = g
a.x = l
m.s = n
m.z = g
m.w = f
m.r = l
assert m.w.o.u.v.txt == "l"