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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

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

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

h = A("h")
b = B("b")
c = C("c")
f = D("f")
n = E("n")
a = F("a")
l = G("l")
d = D("d")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

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

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

h = A("h")
b = B("b")
c = C("c")
f = D("f")
n = E("n")
a = F("a")
l = G("l")
d = D("d")

h.o = a
b.p = h
b.t = a
b.r = c
c.w = b
c.r = l
c.v = l
c.u = n
c.p = f
c.q = h
c.o = h
f.p = d
f.y = b
n.s = f
n.y = c
n.w = b
a.x = h
a.t = c
a.p = b
l.o = f
l.s = c
l.t = c
l.r = n
d.p = f
d.y = b
assert a.t.p.y.p.o.p.r.txt == "c"