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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: F = None
        self.o: E = None
        self.r: A = None
        self.t: D = None
        self.z: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: F = None
        self.o: E = None
        self.r: A = None
        self.t: D = None
        self.z: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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