class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: D = None
        self.v: F = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: C = None
        self.r: E = None
        self.u: C = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: C = None
        self.r: E = None
        self.u: C = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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