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

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

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

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

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

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

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

i.v = d
i.t = l
i.q = l
l.r = d
n.v = d
n.t = l
g.x = l
d.y = j
d.v = g
e.o = d
e.y = l
e.q = j
j.v = d
j.t = l
c.o = d
c.y = l
c.q = n
assert n.v.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

i.v = d
i.t = l
i.q = l
l.r = d
n.v = d
n.t = l
g.x = l
d.y = j
d.v = g
e.o = d
e.y = l
e.q = j
j.v = d
j.t = l
c.o = d
c.y = l
c.q = n
assert n.v.y.v.txt == "d"