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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.q: B = None
        self.w: F = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
d = C("d")
b = D("b")
h = E("h")
e = F("e")
c = G("c")
j = A("j")
n = F("n")

i.t = c
i.u = h
i.q = f
i.v = b
f.p = b
d.q = c
b.p = f
b.v = n
h.p = f
h.q = f
h.u = f
h.s = b
h.w = e
h.t = i
e.s = j
e.y = n
e.q = d
e.o = f
e.t = h
c.o = h
c.p = f
c.q = d
j.t = c
j.u = h
j.q = f
j.v = b
n.s = i
n.y = e
n.q = d
n.o = f
n.t = h
assert f.p.v.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: E = None
        self.q: B = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: D = None
        self.q: B = None
        self.w: F = None
        self.u: B = None
        self.t: A = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
d = C("d")
b = D("b")
h = E("h")
e = F("e")
c = G("c")
j = A("j")
n = F("n")

i.t = c
i.u = h
i.q = f
i.v = b
f.p = b
d.q = c
b.p = f
b.v = n
h.p = f
h.q = f
h.u = f
h.s = b
h.w = e
h.t = i
e.s = j
e.y = n
e.q = d
e.o = f
e.t = h
c.o = h
c.p = f
c.q = d
j.t = c
j.u = h
j.q = f
j.v = b
n.s = i
n.y = e
n.q = d
n.o = f
n.t = h
assert f.p.v.y.q.txt == "d"