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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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