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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.txt = txt

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

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

h.v = k
h.o = k
h.y = j
h.x = j
h.s = g
n.q = k
n.t = l
n.r = l
g.y = l
g.z = f
g.o = c
g.w = c
j.q = n
l.r = h
l.u = c
f.t = k
f.q = h
k.q = n
k.t = c
k.r = l
c.r = h
c.u = l
assert c.u.u.r.x.q.q.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: D = None
        self.s: C = None
        self.x: D = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.txt = txt

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

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

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