class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: F = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.s: C = None
        self.w: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.s: C = None
        self.w: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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