class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: F = None
        self.t: A = None
        self.w: B = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: A = None
        self.v: D = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: A = None
        self.v: D = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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