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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: B = None
        self.p: A = None
        self.r: A = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.r: C = None
        self.v: B = None
        self.txt = txt

c = A("c")
g = B("g")
l = C("l")
h = D("h")
j = E("j")
f = F("f")
d = A("d")
n = E("n")
i = F("i")

c.y = g
g.q = i
g.t = d
l.s = f
l.y = f
l.v = c
h.u = f
j.y = c
j.p = c
j.r = c
j.q = g
j.v = d
f.w = c
f.t = h
f.r = l
f.v = g
d.y = g
n.y = d
n.p = d
n.r = d
n.q = g
n.v = c
i.w = c
i.t = h
i.r = l
i.v = g
assert f.v.q.w.y.q.w.y.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: B = None
        self.p: A = None
        self.r: A = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: D = None
        self.r: C = None
        self.v: B = None
        self.txt = txt

c = A("c")
g = B("g")
l = C("l")
h = D("h")
j = E("j")
f = F("f")
d = A("d")
n = E("n")
i = F("i")

c.y = g
g.q = i
g.t = d
l.s = f
l.y = f
l.v = c
h.u = f
j.y = c
j.p = c
j.r = c
j.q = g
j.v = d
f.w = c
f.t = h
f.r = l
f.v = g
d.y = g
n.y = d
n.p = d
n.r = d
n.q = g
n.v = c
i.w = c
i.t = h
i.r = l
i.v = g
assert f.v.q.w.y.q.w.y.q.r.txt == "l"