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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: A = None
        self.q: A = None
        self.s: G = None
        self.w: A = None
        self.p: C = None
        self.o: G = None
        self.txt = txt

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

k.y = g
l.w = g
l.p = m
b.w = k
f.s = c
j.q = k
j.v = b
j.s = c
g.v = l
g.o = l
g.x = l
g.s = m
g.u = f
g.r = j
i.x = b
i.p = b
i.u = k
i.q = k
i.w = k
i.s = c
i.o = c
c.x = b
c.p = b
c.u = k
c.q = k
c.w = k
c.s = i
c.o = i
m.s = c
assert c.u.y.o.w.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: A = None
        self.q: A = None
        self.s: G = None
        self.w: A = None
        self.p: C = None
        self.o: G = None
        self.txt = txt

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

k.y = g
l.w = g
l.p = m
b.w = k
f.s = c
j.q = k
j.v = b
j.s = c
g.v = l
g.o = l
g.x = l
g.s = m
g.u = f
g.r = j
i.x = b
i.p = b
i.u = k
i.q = k
i.w = k
i.s = c
i.o = c
c.x = b
c.p = b
c.u = k
c.q = k
c.w = k
c.s = i
c.o = i
m.s = c
assert c.u.y.o.w.u.s.txt == "c"