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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.y: E = None
        self.w: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

g.t = f
n.o = j
n.t = j
n.y = d
n.w = d
n.p = d
j.w = g
j.t = d
j.v = n
l.q = j
l.y = f
d.t = f
d.y = f
d.r = j
d.q = j
f.q = j
f.v = l
e.q = j
e.y = f
i.t = f
assert j.t.t.q.v.w.t.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: C = None
        self.y: E = None
        self.w: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

g.t = f
n.o = j
n.t = j
n.y = d
n.w = d
n.p = d
j.w = g
j.t = d
j.v = n
l.q = j
l.y = f
d.t = f
d.y = f
d.r = j
d.q = j
f.q = j
f.v = l
e.q = j
e.y = f
i.t = f
assert j.t.t.q.v.w.t.v.q.txt == "j"