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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

h = A("h")
c = B("c")
j = C("j")
g = D("g")
d = E("d")
l = F("l")

h.v = g
h.o = g
h.p = g
h.s = l
h.r = l
c.y = l
c.u = l
c.t = g
j.t = g
j.y = c
j.o = d
g.u = d
g.v = c
g.r = j
d.r = j
l.s = h
assert c.t.r.y.y.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.s: F = None
        self.r: F = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

h = A("h")
c = B("c")
j = C("j")
g = D("g")
d = E("d")
l = F("l")

h.v = g
h.o = g
h.p = g
h.s = l
h.r = l
c.y = l
c.u = l
c.t = g
j.t = g
j.y = c
j.o = d
g.u = d
g.v = c
g.r = j
d.r = j
l.s = h
assert c.t.r.y.y.s.p.txt == "g"