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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.o: B = None
        self.p: F = None
        self.s: A = None
        self.q: E = None
        self.txt = txt

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

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

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

g.q = h
g.x = l
g.p = j
e.r = h
e.x = h
e.t = i
e.q = i
e.y = c
l.v = g
l.t = j
l.r = j
l.o = j
i.x = g
i.s = g
i.z = e
i.o = e
i.p = j
i.q = h
h.w = g
n.y = e
n.q = e
n.t = e
n.u = g
c.v = g
c.t = n
c.r = j
c.o = j
j.y = e
j.q = e
j.t = e
j.u = g
assert h.w.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: C = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.o: B = None
        self.p: F = None
        self.s: A = None
        self.q: E = None
        self.txt = txt

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

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

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

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