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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: F = None
        self.o: A = None
        self.y: F = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: G = None
        self.t: B = None
        self.v: G = None
        self.z: E = None
        self.o: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: F = None
        self.o: A = None
        self.y: F = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: G = None
        self.t: B = None
        self.v: G = None
        self.z: E = None
        self.o: E = None
        self.txt = txt

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

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

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