class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: C = None
        self.p: E = None
        self.t: G = None
        self.u: G = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: C = None
        self.p: E = None
        self.t: G = None
        self.u: G = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

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