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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: E = None
        self.o: F = None
        self.p: A = None
        self.u: E = None
        self.y: A = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: G = None
        self.p: C = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: E = None
        self.o: F = None
        self.p: A = None
        self.u: E = None
        self.y: A = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: G = None
        self.p: C = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

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

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