class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: C = None
        self.s: E = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.v: B = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.v: B = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

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