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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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