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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: F = None
        self.u: D = None
        self.z: E = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: G = None
        self.w: G = None
        self.x: G = 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.w: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: F = None
        self.u: D = None
        self.z: E = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: G = None
        self.w: G = None
        self.x: G = 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.w: E = None
        self.txt = txt

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

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

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