class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.r: B = None
        self.p: F = None
        self.s: D = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: A = None
        self.r: G = None
        self.p: A = None
        self.txt = txt

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

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

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

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

h = A("h")
i = B("i")
f = C("f")
g = D("g")
l = E("l")
b = F("b")
j = G("j")
a = B("a")
k = E("k")
c = F("c")

h.u = i
h.t = g
h.s = g
h.r = a
h.p = c
h.y = c
h.q = k
i.o = f
i.s = l
f.x = g
f.s = h
f.p = h
f.r = j
g.q = j
g.x = j
g.v = i
g.z = h
l.s = k
b.p = l
j.p = f
a.o = f
a.s = k
k.s = l
c.p = l
assert l.s.s.s.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.r: B = None
        self.p: F = None
        self.s: D = None
        self.q: E = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: A = None
        self.r: G = None
        self.p: A = None
        self.txt = txt

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

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

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

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

h = A("h")
i = B("i")
f = C("f")
g = D("g")
l = E("l")
b = F("b")
j = G("j")
a = B("a")
k = E("k")
c = F("c")

h.u = i
h.t = g
h.s = g
h.r = a
h.p = c
h.y = c
h.q = k
i.o = f
i.s = l
f.x = g
f.s = h
f.p = h
f.r = j
g.q = j
g.x = j
g.v = i
g.z = h
l.s = k
b.p = l
j.p = f
a.o = f
a.s = k
k.s = l
c.p = l
assert l.s.s.s.s.s.s.s.s.txt == "l"