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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: D = None
        self.z: B = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.o: G = None
        self.p: A = None
        self.t: F = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: B = None
        self.z: F = None
        self.r: G = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: F = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

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

h.p = f
h.r = j
b.y = j
b.u = a
b.z = d
b.v = f
b.r = f
f.x = i
f.v = h
f.p = h
f.s = h
f.o = k
f.t = j
e.y = h
e.p = b
e.z = j
e.r = k
e.w = i
i.u = j
j.t = d
j.u = k
j.p = h
j.q = h
j.y = a
k.u = h
k.t = j
k.x = i
k.w = i
a.y = h
a.p = b
a.z = j
a.r = k
a.w = i
d.y = j
d.u = a
d.z = b
d.v = f
d.r = f
assert d.z.u.p.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: D = None
        self.z: B = None
        self.v: C = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.o: G = None
        self.p: A = None
        self.t: F = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: B = None
        self.z: F = None
        self.r: G = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: F = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

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

h.p = f
h.r = j
b.y = j
b.u = a
b.z = d
b.v = f
b.r = f
f.x = i
f.v = h
f.p = h
f.s = h
f.o = k
f.t = j
e.y = h
e.p = b
e.z = j
e.r = k
e.w = i
i.u = j
j.t = d
j.u = k
j.p = h
j.q = h
j.y = a
k.u = h
k.t = j
k.x = i
k.w = i
a.y = h
a.p = b
a.z = j
a.r = k
a.w = i
d.y = j
d.u = a
d.z = b
d.v = f
d.r = f
assert d.z.u.p.v.t.txt == "j"